Skip to content

Conversation

@binamkayastha
Copy link
Member

Closes #230

Summary

  • replace the dictionary audio controls with a consistent volume icon button
  • reuse the flashcard pronunciation playback pattern and stop audio on unmount

Testing

  • pnpm -C nepalingo-web lint
  • pnpm -C nepalingo-web format-check
  • pnpm -C nepalingo-web build

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 4, 2025

Deploying nepalingo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 18aabf4
Status: ✅  Deploy successful!
Preview URL: https://d8a460d5.nepalingo.pages.dev
Branch Preview URL: https://issue-230-dictionary-audio-i.nepalingo.pages.dev

View logs

const newAudio = new Audio(meaning.audio.uri);
setAudio(newAudio);
void newAudio.play();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the same/similar code as the one in Card.tsx. Can we dry up the audio logic so it's not a repeat in this file and the Card file? Let me know if you have questions


const useAudioPlayer = (audioUrl?: string) => {
const audioRef = useRef<HTMLAudioElement | null>(null);
const lastUrlRef = useRef<string | undefined>(audioUrl);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be useStates instead of useRefs?

@binamkayastha binamkayastha added the generated-by-ai Auto-generated contributions by Codex label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

generated-by-ai Auto-generated contributions by Codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In the dictionary page, the audio file should be an icon

2 participants